package com.ihr360.payroll.model.dto.reference;

import com.ihr360.commons.entityhandler.DateHandler;
import com.ihr360.commons.model.entity.NumberIdWithTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import java.util.List;

/**
 * 引用的服务定义
 */
@Entity
@EntityListeners(DateHandler.class)
public class ReferenceApplication extends NumberIdWithTime<Long>{

    /**
     * 引用应用的Id标记
     */
    @Column(length = 20)
    private String refId;

    /**
     * 引用应用名称
     */
    @Column(length = 20)
    private String refName;

    /**
     * 引用所属的服务地址
     */
    @Column(length = 100)
    private String baseUrl;


    @OneToMany(fetch = FetchType.LAZY)
    @JoinColumn
    private List<ReferenceService> services;

    public String getRefId() {
        return refId;
    }

    public void setRefId(String refId) {
        this.refId = refId;
    }

    public String getRefName() {
        return refName;
    }

    public void setRefName(String refName) {
        this.refName = refName;
    }

    public String getBaseUrl() {
        return baseUrl;
    }

    public void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }

    public List<ReferenceService> getServices() {
        return services;
    }

    public void setServices(List<ReferenceService> services) {
        this.services = services;
    }
}